package cn.edu.niit.alienlab.jshttplessonserver.dao;

import cn.edu.niit.alienlab.jshttplessonserver.domain.DirectorInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DirectorInfoDao {
    /*按影片id查询导演信息*/
    @Select("SELECT di.*,movie_id FROM director_info di ,movie_info mi " +
            "WHERE mi.director_id=di.director_id AND mi.movie_id=#{movie_id}")
    public DirectorInfo selectDirectorByMovieId(Integer movie_id);

    @Select("select director_id,name,name_en,img from director_info where name like concat('%',#{keyword},'%') limit 0,20")
    public List<DirectorInfo> selectAllDirectors(String keyword);
}
